﻿<Window x:Class="P2.Cuberry.Modules.Framework.ModuleManager.ModulesImportView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
    xmlns:basec="clr-namespace:P2.Cuberry.Framework.Helper;assembly=P2.Cuberry.Framework.Helper" 
    Icon="/P2.Cuberry;component/Images/CuberryIcon32.ico"
    Title="Peacequare Cuberry" Width="920" Height="480"  
    Background="{DynamicResource P2BackgroundBrush}" 
    Closing="Window_Closing"
    >

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/CuberryDataGrid.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
            
    <Grid>
        <Grid.Resources>
            <Image x:Key="SaveIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/save.png" />
            <Image x:Key="CancelIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/cancel.png" />
            <Image x:Key="ClosingIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/save.png" />
            <Image x:Key="ValidateIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.Framework.ModuleManager;component/Images/Validate.png" />
        </Grid.Resources>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>

        <!-- Row 0 Start -->
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Content="{Translate DialogHeaderModulesImport}" Style="{StaticResource P2DetailViewHeaderTextStyle}" />
        
        <Separator Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Height="0"/>
        <!-- Row 0 End -->

        <!-- Row 1: Menu Start -->
        <Border  Grid.Row="1" Grid.Column="0"  Style="{StaticResource P2MenuBorderStyle}">
            <Menu Grid.Row="1" x:Name="menuMain" Style="{StaticResource P2MenuStyle}" >
                <MenuItem x:Name="ValidateBtn" Margin="2,1,0,2"  Header="{Translate ValidateBtn}" Command="{Binding ModuleValidateCommand}"  Icon="{StaticResource ValidateIcon}" Style="{StaticResource P2MenuItemStyle}" />
                <MenuItem x:Name="UploadBtn" Margin="2,1,0,2"  Header="{Translate UploadModuleBtn}" Command="{Binding ModuleUploadCommand}"  Icon="{StaticResource SaveIcon}" Style="{StaticResource P2MenuItemStyle}" />                
            </Menu>
        </Border>
        <!-- Row 1 End -->

        <!-- Row 2: All Fields -->
        <Border  Grid.Row="2" Grid.Column="0"  Style="{StaticResource P2ContentBorderStyle}">
            <Grid Grid.Row="2" Grid.Column="0">
                
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="604*"/>
                    <ColumnDefinition Width="0*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="110" />
                    <!--<RowDefinition Height="30" />-->
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                
                <TextBlock Grid.Row="0" Margin="5,6,0,0" Height="100" HorizontalAlignment="Stretch"  Name="InformationBlock01" 
                           Text="{Binding ImportMessage}"
                           VerticalAlignment="Top"/>

                <!--<Label Grid.Row="1" Height="25" HorizontalAlignment="Stretch"  Content="{Binding ExceptionLabelText}" Visibility="{Binding ExceptionLableVisibility}" 
                       Margin="5,6,0,0" Background="#FFB43333" />-->

                <!--Style="{DynamicResource CuberryDataGridStyle}"-->
                
                <DataGrid Grid.Row="2" Margin="5,6,0,0" 
                        Name="ApplicationResourceList"                                              
                        Style="{DynamicResource CuberryDataGridStyle}"
                        ItemsSource="{Binding ImportList}"
                        VerticalAlignment="Top" 
                        RowHeight="22" IsReadOnly="False" CanUserResizeRows="True">
                    
                    <DataGrid.Columns>
                        <DataGridTextColumn Header="{Translate ItemNameL}" IsReadOnly="True" Width="400" MinWidth="200" Binding="{Binding ItemName}"/>
                        <DataGridTextColumn Header="{Translate ActionTypeL}" IsReadOnly="True" Width="125" MinWidth="50" Binding="{Binding ActionType}"/>
                        <DataGridTemplateColumn Header="{Translate ActionToBeTakenL}" Width="110" MinWidth="50" IsReadOnly="False">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding ActionToBeTaken}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                            <DataGridTemplateColumn.CellEditingTemplate>
                                <DataTemplate>
                                    <ComboBox IsEditable="False"  Height="20" ItemsSource="{Binding ActionList}" 
                                              SelectedItem="{Binding Path = ActionToBeTaken}" 
                                               Foreground="Black" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellEditingTemplate>
                        </DataGridTemplateColumn>
                        
                        <!--<DataGridTemplateColumn Header="Status" Width="50" MinWidth="20" IsReadOnly="True">
                            
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Image Source="{Binding StatusImage}" />
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                        </DataGridTemplateColumn>-->
                                                
                        
                        <DataGridTextColumn Header="{Translate ProcessL}" IsReadOnly="True" Width="*" MinWidth="40" Binding="{Binding Process, Mode=TwoWay}" />
                    </DataGrid.Columns>                    
                </DataGrid>
            </Grid>
        </Border>

        <!-- Row 2: End -->

        <!-- Row 3: Bottom: Status Bar Start -->
        <Border Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripBorderStyle}" >
            <Grid Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripGridStyle}">
                <basec:P2StatusStrip x:Name="StatusStrip" MessageStack2="{Binding MessageStack}"  Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Left" ContentStringFormat=""></basec:P2StatusStrip>
                <TextBox Name="Status" Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Right" Text="{Binding Model.StatusName, Mode=OneWay}" IsReadOnly="True" BorderBrush="Transparent" />
            </Grid>
        </Border>

        <!-- Row 3: End -->
    </Grid>
</Window>
